package com.hqx.user.master.controller;

import com.hqx.cloud.output.dto.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 用户控制器
 * @author: Yz
 * @create: 2020-04-01 15:06
 **/
@RestController
public class UserController {

    @Value("${server.port}")
    private String port ;

    @RequestMapping(value = "/getUser",method = RequestMethod.GET)
    public User getUser(){
        User user = new User();
        user.setId("1");
        user.setName("xiaoming");
        user.setAddr("user-service:"+port);
        return user;
    }

    @RequestMapping(value = "/getString",method = RequestMethod.GET)
    public String getString(){
        return "bbbbb";
    }
}
